<template>
  <div>
    <!-- 搜索栏区域 -->
    <el-card class="SearchCard" body-style="padding:0px">
      <el-row>
        <el-col :span="2">
          <div class="SearchTitle">条件搜索栏</div>
        </el-col>
        <el-col :span="4">
          <el-row>
            <el-col :span="10">
              <div class="SearchLable">搜索关键字</div>
            </el-col>

            <el-col :span="14">
              <div class="SearchLable">
                <el-input placeholder="请输入内容" v-model="queryInfo.srm" clearable @clear="clearEvent"></el-input>
              </div>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchList()">搜索</el-button>
          </div>
        </el-col>
      </el-row>
    </el-card>
    <el-card class="TableCard" :body-style="{ padding: '0px' }">
      <div>
        <el-table
          :data="tableData"
          border
          height="550"
          :header-cell-style="{ 'text-align':'center',background: '#3F9DFD', color: '#FFF' }"
          :cell-style="{'text-align':'center'}"
          size="medium"
          stripe
          style="width: 100%;font-size:12px"
        >
          <el-table-column prop="drugCode" label="药品编码" width="100"></el-table-column>
          <el-table-column prop="name" label="操作" width="100">
            <template slot-scope="scope">
              <div v-if="scope.row.drugType==0">
                <el-button
                  type="text"
                  v-if="scope.row.dosageDrugId>0"
                  @click="showRuleAll(scope.row.dosageDrugId,scope.row.id,scope.row.drugName)"
                >查看</el-button>
                <el-button
                  type="text"
                  @click="showAddRule(scope.row.drugName,scope.row.drugCode,scope.row.drugType)"
                >新增</el-button>
              </div>
              <div v-else-if="scope.row.drugType==1">
                <div v-if="scope.row.dosageDrugId>0">
                  <el-button
                    type="text"
                    @click="showRuleAllZY(scope.row.dosageDrugId,scope.row.id,scope.row.drugName)"
                  >查看</el-button>
                  <el-button type="text" @click="open2(scope.row.dosageDrugId)">删除</el-button>
                </div>
                <el-button
                  type="text"
                  v-else
                  @click="showAddRuleZY(scope.row.drugName,scope.row.drugCode,scope.row.drugType)"
                >新增</el-button>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="drugName" label="药品名称"></el-table-column>

          <!-- <el-table-column prop="cbrand" label="商品名"></el-table-column> -->
          <el-table-column label="给药类型">
            <template slot-scope="scope">
              <!-- {{(scope.row.nameType)}} -->
              <div v-if="scope.row.nameType==8">西药</div>
              <div v-else-if="scope.row.nameType==2">草药</div>
              <div v-else-if="scope.row.nameType==6">中成药</div>
              <!-- {{(scope.row.nameType==1)?"全身给药":(scope.row.nameType==2)?"局部给药":(scope.row.nameType==3)?"所有方式给药":"系统默认"}} -->
            </template>
          </el-table-column>

          <el-table-column prop="drugSpec" label="药品规格"></el-table-column>
          <el-table-column prop="compName" label="药品生产厂家" width="220"></el-table-column>
          <el-table-column prop="approvalCode" label="批准文号"></el-table-column>
          <el-table-column prop="doseUnit" label="给药单位"></el-table-column>
        </el-table>
      </div>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryInfo.pagenum"
          :page-sizes="[20, 50, 100]"
          :page-size="queryInfo.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="this.total"
          background
        ></el-pagination>
      </div>
    </el-card>

    <!-- 新增规则 -->
    <el-dialog
      :title="'新增规则'+'—'+this.addRuleData.drugName"
      :visible.sync="dialogVisible"
      width="55%"
      :before-close="handleClose"
    >
      <div class="addRuleAdverse">
        <el-form
          :inline="true"
          :model="addRuleData"
          class="demo-form-inline addForm"
          label-width="180px"
        >
          <!-- <el-form-item label="药品名称">
            <el-input
              v-model="addRuleData.drugName"
              size="medium"
            ></el-input>
          </el-form-item>-->

          <el-row>
            <el-col :span="12">
              <el-form-item label="给药途径">
                <el-input v-model="addRuleData.routeName" size="medium">
                  <el-button slot="append" @click="showRoute(1)">选择</el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="年龄低值">
                <el-input v-model="addRuleData.ageLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="是否不等于年龄低值">
                <el-select v-model="addRuleData.unequalLow" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="年龄低值单位">
                <el-select v-model="addRuleData.ageLowUnit" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowUnitOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="年龄高值">
                <el-input v-model="addRuleData.ageHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="是否不等于年龄高值">
                <el-select v-model="addRuleData.unequalHigh" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="	年龄高值单位">
                <el-select v-model="addRuleData.ageHighUnit" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowUnitOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="体重低值">
                <el-input v-model="addRuleData.weighLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="体重高值">
                <el-input v-model="addRuleData.weighHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="计算方式">
                <el-select v-model="addRuleData.calculateLabel">
                  <el-option
                    v-for="item in calOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次低剂量">
                <el-input v-model="addRuleData.doseEachLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次低剂量单位">
                <el-input v-model="addRuleData.doseEachLowUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次高剂量">
                <el-input v-model="addRuleData.doseEachHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次高剂量单位">
                <el-input v-model="addRuleData.doseEachHighUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日低剂量">
                <el-input v-model="addRuleData.doseDayLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日低剂量单位">
                <el-input v-model="addRuleData.doseDayLowUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日高剂量">
                <el-input v-model="addRuleData.doseDayHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日高剂量单位">
                <el-input v-model="addRuleData.doseDayHighUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次限制量">
                <el-input v-model="addRuleData.maxDoseEach" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次极量单位">
                <el-input v-model="addRuleData.maxDoseEachUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日限制量">
                <el-input v-model="addRuleData.maxDoseDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日限制量单位">
                <el-input v-model="addRuleData.maxDoseDayUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="最低给药频次中的次数">
                <el-input v-model="addRuleData.freQuencyLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最低给药频次中的天数">
                <el-input v-model="addRuleData.freQuencyLowDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="最高给药频次中的次数">
                <el-input v-model="addRuleData.freQuencyHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最高给药频次中的天数">
                <el-input v-model="addRuleData.freQuencyHighDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="持续用药天数推荐值低值">
                <el-input v-model="addRuleData.durationLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="持续用药天数推荐值高值">
                <el-input v-model="addRuleData.durationHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="持续用药天数限制值">
                <el-input v-model="addRuleData.durationMax" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="治疗剂量">
                <el-input v-model="addRuleData.treatmentDose" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="治疗剂量单位">
                <el-input v-model="addRuleData.treatmentDoseUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次警戒值剂量">
                <el-input v-model="addRuleData.warnDoseEach" placeholder="限制级别更高" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次警戒值剂量单位">
                <el-input v-model="addRuleData.warnDoseEachUnit" placeholder size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每天警戒值剂量">
                <el-input v-model="addRuleData.warnDoseDay" placeholder="限制级别更高" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每天警戒值剂量单位">
                <el-input v-model="addRuleData.warnDoseDayUnit" placeholder size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="问题详细信息描述">
                <el-input
                  v-model="addRuleData.abstractDesc"
                  type="textarea"
                  :rows="5"
                  size="medium"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addRule()">新 增</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 新增规则 -->
    <el-dialog
      :title="'新增规则'+'—'+this.addRuleZYData.drugName"
      :visible.sync="dialogZYVisible"
      width="35%"
      :before-close="handleClose"
    >
      <div class="addRuleAdverse">
        <el-form :inline="true" :model="addRuleZYData" class="demo-form-inline" label-width="180px">
          <!-- <el-form-item label="药品名称">
            <el-input
              v-model="addRuleData.drugName"
              size="medium"
            ></el-input>
          </el-form-item>-->
          <el-form-item label="毒性等级">
            <el-select v-model="addRuleZYData.toxiLevel" size="medium">
              <el-option
                v-for="item in DuOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="毒性描述">
            <el-input v-model="addRuleZYData.toxiWarning" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="妊娠等级">
            <el-select v-model="addRuleZYData.pregnancyLevel" size="medium" placeholder="请选择">
              <el-option
                v-for="item in RSOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="单次剂量低值">
            <el-input v-model="addRuleZYData.lowDosage" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="单次剂量高值">
            <el-input v-model="addRuleZYData.highDosage" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="单次剂量单位">
            <el-input v-model="addRuleZYData.dosageUnit" size="medium"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addRuleZY()">新 增</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 选择给药途径ID -->
    <el-dialog
      title="选择给药途径"
      :visible.sync="RouteVisible"
      class="editDialog"
      width="30%"
      :before-close="handleClose"
    >
      <div style="width:100%;height:527px">
        <div class="addInput">
          <el-input v-model="routeData.srm" size="small" placeholder="请输入内容"></el-input>
          <el-button style="margin-right:8px" type="primary" size="small" @click="SearchDrug()">搜索</el-button>
        </div>
        <el-table
          :data="routeData.tableData"
          stripe
          border
          height="400"
          style="width: 100%;font-size: 10px"
          :header-cell-style="{'text-align':'center'}"
          :row-style="{height:'40px'}"
          :cell-style="{'text-align':'center',padding:'0px'}"
          @row-click="handleRow"
          @selection-change="handleSelectionChange"
        >
          <el-table-column label width="35">
            <template slot-scope="scope">
              <el-radio
                :label="scope.row"
                v-model="routeData.radioId"
                @change.native="handleSelectionChange(scope.row)"
              >&nbsp;</el-radio>
            </template>
          </el-table-column>

          <el-table-column prop="routeId" width="150" label="给药途径编码"></el-table-column>
          <el-table-column prop="routeName" label="给药途径名称"></el-table-column>
        </el-table>
        <!-- <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination> -->
        <div class="dialogBlock">
          <el-pagination
            @size-change="handleSizeChange1"
            @current-change="handleCurrentChange1"
            current-page.sync="1"
            :page-size="100"
            layout="total, prev, pager, next"
            :total="routeData.total"
          ></el-pagination>
        </div>
        <span slot="footer" class="dialog-footer">
          <div class="SortFoot">
            <el-button
              style="margin-right:8px"
              type="primary"
              size="small"
              @click="SelectRoute()"
            >确定</el-button>
            <el-button style="margin-right:8px" @click="RouteVisible = false" size="small">取消</el-button>
          </div>
        </span>
      </div>
    </el-dialog>

    <!-- 所有规则 -->
    <el-dialog
      title="所有剂量规则"
      :visible.sync="RuleAllVisible"
      class="editDialog"
      width="55%"
      stripe
      :before-close="handleClose"
    >
      <div>
        <el-card style="height:530px">
          <el-table
            :data="RuleAllData.RuleAllTableList"
            :header-cell-style="{'text-align':'center'}"
            :cell-style="{'text-align':'center',padding:'0px'}"
            border
            stripe
            height="450"
            style="width: 100%"
          >
            <el-table-column type="index" label="序号" width="50" fixed></el-table-column>
            <el-table-column label="操作" width="100" fixed>
              <template slot-scope="scope">
                <el-button
                  type="text"
                  style="margin-right:12px"
                  @click="showRuleOne(scope.row.id)"
                >查看</el-button>
                <el-button type="text" @click="open(scope.row.id,scope.row.scrId)">删除</el-button>
              </template>
            </el-table-column>

            <el-table-column label="给药类型" prop="routeId" width="120">
              <!-- <template
                slot-scope="scope"
              >{{(scope.row.routeId==0)?"系统用药":(scope.row.routeId==1)?"全身给药":(scope.row.routeId==2)?"局部给药":(scope.row.routeId==3)?"所有方式给药":""}}</template>-->
            </el-table-column>

            <el-table-column prop="ageLow" label="年龄低值" width="150"></el-table-column>
            <el-table-column prop="unequalLow" label="是否不等于年龄低值" width="150">
              <template
                slot-scope="scope"
              >{{(scope.row.unequalLow==0)?"等于":(scope.row.unequalLow==1)?"不等于":""}}</template>
            </el-table-column>
            <el-table-column prop="ageLowUnit" label="年龄低值单位" width="150"></el-table-column>
            <el-table-column prop="ageHigh" label="年龄高值" width="150"></el-table-column>
            <el-table-column prop="unequalHigh" label="是否不等于年龄高值" width="150">
              <template
                slot-scope="scope"
              >{{(scope.row.unequalHigh==0)?"等于":(scope.row.unequalHigh==1)?"不等于":""}}</template>
            </el-table-column>
            <el-table-column prop="ageHighUnit" label="年龄高值单位" width="150"></el-table-column>
            <el-table-column prop="weighLow" label="体重低值" width="150"></el-table-column>
            <el-table-column prop="weighHigh" label="体重高值" width="150"></el-table-column>
            <el-table-column prop="calculateLabel" label="计算方式" width="150"></el-table-column>
            <el-table-column prop="doseEachLow" label="每次低剂量" width="150"></el-table-column>
            <el-table-column prop="doseEachLowUnit" label="每次低剂量单位" width="150"></el-table-column>
            <el-table-column prop="doseEachHigh" label="每次高剂量" width="150"></el-table-column>
            <el-table-column prop="doseEachHighUnit" label="每次高剂量单位" width="150"></el-table-column>
            <el-table-column prop="doseDayLow" label="每日低剂量" width="150"></el-table-column>
            <el-table-column prop="doseDayLowUnit" label="每日低剂量单位" width="150"></el-table-column>

            <el-table-column prop="doseDayHigh" label="每日高剂量" width="150"></el-table-column>
            <el-table-column prop="doseDayHighUnit" label="每日高剂量单位" width="150"></el-table-column>
            <el-table-column prop="maxDoseEach" label="每次限制量" width="150"></el-table-column>
            <el-table-column prop="maxDoseEachUnit" label="每次限制单位" width="150"></el-table-column>
            <el-table-column prop="maxDoseDay" label="每日限制量" width="150"></el-table-column>
            <el-table-column prop="maxDoseDayUnit" label="每日限制量单位" width="150"></el-table-column>

            <el-table-column prop="freQuencyLow" label="最低给药频次中的次数" width="150"></el-table-column>
            <el-table-column prop="freQuencyLowDay" label="最低给药频次中的天数" width="150"></el-table-column>
            <el-table-column prop="freQuencyHigh" label="最高给药频次中的次数" width="150"></el-table-column>
            <el-table-column prop="freQuencyHighDay" label="最高给药频次中的天数" width="150"></el-table-column>
            <el-table-column prop="durationLow" label="持续用药天数推荐值低值" width="150"></el-table-column>
            <el-table-column prop="durationHigh" label="持续用药天数推荐值高值" width="150"></el-table-column>
            <el-table-column prop="durationMax" label="持续用药天数限制值" width="150"></el-table-column>
            <el-table-column prop="treatmentDose" label="治疗剂量" width="150"></el-table-column>

            <el-table-column prop="treatmentDoseUnit" label="治疗剂量单位" width="150"></el-table-column>

            <el-table-column prop="warnDoseEach" label="每次警戒值剂量" width="150"></el-table-column>
            <el-table-column prop="warnDoseEachUnit" label="每次警戒值剂量单位" width="150"></el-table-column>
            <el-table-column prop="warnDoseDay" label="每天警戒值剂量" width="150"></el-table-column>
            <el-table-column prop="warnDoseDayUnit" label="	每天警戒值剂量单位" width="150"></el-table-column>

            <el-table-column width="250" prop="abstractDesc" label="问题详细信息描述">
              <template slot-scope="scope">
                <div v-html="scope.row.abstractDesc"></div>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
            @size-change="handleSizeChange2"
            @current-change="handleCurrentChange2"
            :current-page="1"
            :page-sizes="[9, 20, 50]"
            :page-size="RuleAllData.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="RuleAllData.total"
          ></el-pagination>
        </el-card>
      </div>
    </el-dialog>
    <!-- 查看规则 -->
    <el-dialog
      :title="'剂量规则'+'—'+this.RuleAllData.drugName"
      :visible.sync="showRuleOneVisible"
      width="55%"
      :before-close="handleClose"
    >
      <div class="addRuleAdverse">
        <el-form
          :inline="true"
          :model="showRuleOneData"
          class="demo-form-inline addForm"
          label-width="180px"
        >
          <!-- <el-form-item label="药品名称">
            <el-input
              v-model="showRuleOneData.drugName"
              size="medium"
            ></el-input>
          </el-form-item>-->
          <el-row>
            <el-col :span="12">
              <el-form-item label="给药途径ID">
                <el-input v-model="showRuleOneData.routeName" size="medium">
                  <el-button slot="append" @click="showRoute(2)">选择</el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="年龄低值">
                <el-input v-model="showRuleOneData.ageLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="是否不等于年龄低值">
                <el-select v-model="showRuleOneData.unequalLow" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="年龄低值单位">
                <el-select v-model="showRuleOneData.ageLowUnit" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowUnitOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="年龄高值">
                <el-input v-model="showRuleOneData.ageHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="是否不等于年龄高值">
                <el-select v-model="showRuleOneData.unequalHigh" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="	年龄高值单位">
                <el-select v-model="showRuleOneData.ageHighUnit" size="medium" placeholder="请选择">
                  <el-option
                    v-for="item in LowUnitOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="体重低值">
                <el-input v-model="showRuleOneData.weighLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="体重高值">
                <el-input v-model="showRuleOneData.weighHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="计算方式">
                <el-select v-model="showRuleOneData.calculateLabel">
                  <el-option
                    v-for="item in calOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次低剂量">
                <el-input v-model="showRuleOneData.doseEachLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次低剂量单位">
                <el-input v-model="showRuleOneData.doseEachLowUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次高剂量">
                <el-input v-model="showRuleOneData.doseEachHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次高剂量单位">
                <el-input v-model="showRuleOneData.doseEachHighUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日低剂量">
                <el-input v-model="showRuleOneData.doseDayLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日低剂量单位">
                <el-input v-model="showRuleOneData.doseDayLowUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日高剂量">
                <el-input v-model="showRuleOneData.doseDayHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日高剂量单位">
                <el-input v-model="showRuleOneData.doseDayHighUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次限制量">
                <el-input v-model="showRuleOneData.maxDoseEach" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次极量单位">
                <el-input v-model="showRuleOneData.maxDoseEachUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每日限制量">
                <el-input v-model="showRuleOneData.maxDoseDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每日限制量单位">
                <el-input v-model="showRuleOneData.maxDoseDayUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="最低给药频次中的次数">
                <el-input v-model="showRuleOneData.freQuencyLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最低给药频次中的天数">
                <el-input v-model="showRuleOneData.freQuencyLowDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="最高给药频次中的次数">
                <el-input v-model="showRuleOneData.freQuencyHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="最高给药频次中的天数">
                <el-input v-model="showRuleOneData.freQuencyHighDay" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="持续用药天数推荐值低值">
                <el-input v-model="showRuleOneData.durationLow" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="持续用药天数推荐值高值">
                <el-input v-model="showRuleOneData.durationHigh" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="持续用药天数限制值">
                <el-input v-model="showRuleOneData.durationMax" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="治疗剂量">
                <el-input v-model="showRuleOneData.treatmentDose" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="治疗剂量单位">
                <el-input v-model="showRuleOneData.treatmentDoseUnit" size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每次警戒值剂量">
                <el-input v-model="showRuleOneData.warnDoseEach" placeholder="限制级别更高" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每次警戒值剂量单位">
                <el-input v-model="showRuleOneData.warnDoseEachUnit" placeholder size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="每天警戒值剂量">
                <el-input v-model="showRuleOneData.warnDoseDay" placeholder="限制级别更高" size="medium"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="每天警戒值剂量单位">
                <el-input v-model="showRuleOneData.warnDoseDayUnit" placeholder size="medium"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="问题详细信息描述">
                <!-- v-html="showRuleOneData.abstractdesc" -->
                <el-input
                  type="textarea"
                  :autosize="{ minRows: 5, maxRows: 5}"
                  v-model="showRuleOneData.abstractdesc"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="updateRuleOne()">更 新</el-button>
        <el-button @click="showAdultRuleOneVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 查看中药规则 -->
    <el-dialog
      :title="'剂量规则'+'—'+this.shwoRuleOneZYData.drugName"
      :visible.sync="showRuleOneZYVisible"
      width="35%"
      :before-close="handleClose"
    >
      <div class="addRuleAdverse">
        <el-form
          :inline="true"
          :model="shwoRuleOneZYData"
          class="demo-form-inline"
          label-width="180px"
        >
          <el-form-item label="毒性等级">
            <el-select v-model="shwoRuleOneZYData.toxiLevel" size="medium" placeholder="请选择">
              <el-option
                v-for="item in DuOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="毒性描述">
            <el-input v-model="shwoRuleOneZYData.toxiWarning" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="妊娠等级">
            <el-select v-model="shwoRuleOneZYData.pregnancyLevel" size="medium" placeholder="请选择">
              <el-option
                v-for="item in RSOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="单次剂量低值">
            <el-input v-model="shwoRuleOneZYData.lowDosage" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="单次剂量高值">
            <el-input v-model="shwoRuleOneZYData.highDosage" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="单次剂量单位">
            <el-input v-model="shwoRuleOneZYData.dosageUnit" size="medium"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="updateRuleOneZY()">更 新</el-button>
        <el-button @click="showRuleOneZYVisible = false">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  // getRuleListDosa,
  // addRuleInfoDosa,
  getRouteJson,
  // showRuleAllDosa,
  // showRuleOneDosa,
  // updateRuleOneDosa,
  // deleteRuleDosa,
  // showRuleDiseaseAge
  getRuleListDosa,
  addRuleInfoDosa,
  showRuleAllDosa,
  showRuleOneDosa,
  updateRuleOneDosa,
  deleteRuleDosa,
  addRuleInfoDosaZY,
  showRuleAllDosaZY,
  deleteRuleDosaZY,
} from "@/api/rad";
export default {
  data() {
    return {
      queryInfo: {
        srm: "",
        page: 1,
        pageSize: 20,
      },
      total: 0,
      tableData: [],
      SlOptions: [
        {
          value: 0,
          label: "拦截",
        },
        {
          value: 1,
          label: "禁忌",
        },
        {
          value: 2,
          label: "不推荐",
        },
        {
          value: 3,
          label: "轻微",
        },
      ],
      RouteOptions: [
        {
          value: 1,
          label: "全身给药",
        },
        {
          value: 2,
          label: "局部给药",
        },
        {
          value: 3,
          label: "所有方式给药",
        },
      ],
      f20options: [
        {
          value: 1,
          label: 1,
        },
        {
          value: 2,
          label: 2,
        },
        {
          value: 3,
          label: 3,
        },
        {
          value: 4,
          label: 4,
        },
        {
          value: 5,
          label: 5,
        },
      ],
      LowOptions: [
        {
          value: 0,
          label: "等于",
        },
        {
          value: 1,
          label: "不等于",
        },
      ],
      LowUnitOptions: [
        {
          value: "周",
          label: "周",
        },
        {
          value: "月",
          label: "月",
        },
        {
          value: "年",
          label: "年",
        },
      ],
      calOptions: [
        {
          value: 1,
          label: "常规",
        },
        {
          value: 2,
          label: "体重",
        },
        {
          value: 3,
          label: "体表",
        },
      ],
      DuOptions: [
        {
          value: "",
          label: "无毒",
        },
        {
          value: 1,
          label: "大毒",
        },
        {
          value: 2,
          label: "有毒",
        },
        {
          value: 3,
          label: "小毒",
        },
      ],
      RSOptions: [
        {
          value: "",
          label: "全部",
        },
        {
          value: 1,
          label: "孕妇禁用",
        },
        {
          value: 2,
          label: "孕妇慎用",
        },
      ],
      dialogVisible: false,
      RouteVisible: false,
      routeData: {
        srm: "",
        page: "",
        pageSize: "",
        load: 0,
        total: 0,
        tableData: [],
        radioId: [],
      },
      addRuleData: {
        drugName: "",
        drugCode: "",
        drugType: "",
        scrId: "",
        ageWeighLabel: "",
        routeId: "",
        routeName: "",
        ageLow: "",
        unequalLow: "",
        ageLowUnit: "",
        ageHigh: "",
        unequalHigh: "",
        ageHighUnit: "",
        weighLow: "",
        weighHigh: "",
        calculateLabel: "",
        doseEachLow: "",
        doseEachLowUnit: "",
        doseEachHigh: "",
        doseEachHighUnit: "",
        doseDayLow: "",
        doseDayLowUnit: "",
        doseDayHigh: "",
        doseDayHighUnit: "",
        maxDoseEach: "",
        maxDoseEachUnit: "",
        maxDoseDay: "",
        maxDoseDayUnit: "",
        freQuencyLow: "",
        freQuencyLowDay: "",
        freQuencyHigh: "",
        freQuencyHighDay: "",
        durationLow: "",
        durationHigh: "",
        durationMax: "",
        treatmentDose: "",
        treatmentDoseUnit: "",
        warnDoseEach: "",
        warnDoseEachUnit: "",
        warnDoseDay: "",
        warnDoseDayUnit: "",
        abstractDesc: "",
      },
      RuleAllVisible: false,
      RuleAllData: {
        drugName: "",
        dosageDrugId: "",
        // routeDrugId: "",
        page: 1,
        pageSize: 9,
        total: 0,
        RuleAllTableList: [],
      },
      RuleZYAllData: {
        drugName: "",
        dosageDrugId: "",
        drugName: "",
        toxiLevel: "",
        toxiWarning: "",
        pregnancyLevel: "",
        lowDosage: "",
        highDosage: "",
        dosageUnit: "",
      },
      showRuleOneVisible: false,
      showRuleOneData: {
        scrId: "",
        ageLow: "",
        unequalLow: "",
        ageLowUnit: "",
        ageHigh: "",
        unequalHigh: "",
        ageHighUnit: "",
        weighLow: "",
        weighHigh: "",
        calculateLabel: "",
        doseEachLow: "",
        doseEachLowUnit: "",
        doseEachHigh: "",
        doseEachHighUnit: "",
        doseDayLow: "",
        doseDayLowUnit: "",
        doseDayHigh: "",
        doseDayHighUnit: "",
        maxDoseEach: "",
        maxDoseEachUnit: "",
        maxDoseDay: "",
        maxDoseDayUnit: "",
        freQuencyLow: "",
        freQuencyLowDay: "",
        freQuencyHigh: "",
        freQuencyHighDay: "",
        durationLow: "",
        durationHigh: "",
        durationMax: "",
        treatmentDose: "",
        treatmentDoseUnit: "",
        warnDoseEach: "",
        warnDoseEachUnit: "",
        warnDoseDay: "",
        warnDoseDayUnit: "",
        abstractdesc: "",
      },
      DiseaseVisible: false,
      DiseaseData: {
        srm: "",
        page: "",
        pageSize: "",
        load: 0,
        total: 0,
        tableData: [],
        radioId: [],
      },
      dialogZYVisible: false,
      addRuleZYData: {
        drugCode: "",
        drugType: "",
        toxiLevel: "",
        toxiWarning: "",
        pregnancyLevel: "",
        lowDosage: "",
        highDosage: "",
        dosageUnit: "",
      },
      showRuleOneZYVisible: false,
      shwoRuleOneZYData: {
        // id: "",
        drugName: "",
        dosageDrugId: "",
        toxiLevel: "",
        toxiWarning: "",
        pregnancyLevel: "",
        lowDosage: "",
        highDosage: "",
        dosageUnit: "",
      },
    };
  },
  created: function () {
    this.getRuleListDosa();
  },
  methods: {
    handleClose(done) {
      done();
    },
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize;
      console.log(this.queryInfo);
      this.getRuleListDosa();
    },

    handleCurrentChange(newPage) {
      this.queryInfo.page = newPage;
      console.log(this.queryInfo);
      this.getRuleListDosa();
    },
    handleSizeChange1(newSize) {
      this.routeData.pageSize = newSize;

      this.getRouteJson();
    },
    handleCurrentChange1(newPage) {
      this.routeData.page = newPage;
      this.getRouteJson();
    },
    handleSizeChange2(newSize) {
      this.RuleAllData.pageSize = newSize;
      this.showRuleAllRoute();
    },
    handleCurrentChange2(newPage) {
      this.RuleAllData.page = newPage;
      this.showRuleAllRoute();
    },
    handleSizeChange3(newSize) {
      this.DiseaseData.pageSize = newSize;
      this.showRuleDiseaseAge();
    },
    handleCurrentChange3(newPage) {
      this.DiseaseData.page = newPage;
      this.showRuleDiseaseAge();
    },
    async getRuleListDosa() {
      let res = await this.$rad.getRuleListDosa({
        srm: this.queryInfo.srm,
        page: this.queryInfo.page,
        pageSize: this.queryInfo.pageSize,
      });
      (this.tableData = res.rows), (this.total = res.total);
      console.log(res.rows);
    },
    getSearchList() {
      this.getRuleListDosa();
    },
    clearEvent() {},
    showAddRule(drugName, drugCode, drugType) {
      this.addRuleData.drugType = drugType;
      this.addRuleData.drugName = drugName;
      this.addRuleData.drugCode = drugCode;
      this.dialogVisible = true;
    },
    showAddRuleZY(drugName, drugCode, drugType) {
      this.addRuleZYData.drugType = drugType;
      this.addRuleZYData.drugName = drugName;
      this.addRuleZYData.drugCode = drugCode;
      this.dialogZYVisible = true;
    },
    showRoute(load) {
      this.RouteVisible = true;
      this.routeData.load = load;
      this.getRouteJson();
    },
    async getRouteJson() {
      let res = await this.$rad.getRouteJson({
        srm: this.routeData.srm,
        page: this.routeData.page,
        pageSize: this.routeData.pageSize,
      });
      console.log(res);
      this.routeData.tableData = res.rows;
      this.routeData.total = res.total;
    },
    SelectRoute() {
      if (this.routeData.radioId.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择给药途径",
        });
      } else {
        if (this.routeData.load == 1) {
          console.log(this.routeData.radioId);
          this.addRuleData.routeName = this.routeData.radioId.routeName;
          this.addRuleData.routeId = this.routeData.radioId.routeId;
        } else if (this.routeData.load == 2) {
          console.log(2);
          this.showRuleOneData.routeName = this.routeData.radioId.routeName;
          this.showRuleOneData.routeId = this.routeData.radioId.routeId;
        }

        this.RouteVisible = false;
      }
    },
    async addRule() {
      console.log(this.addRuleData);
      let res = await this.$rad.addRuleInfoDosa({
        drugType: this.addRuleData.drugType,
        drugCode: this.addRuleData.drugCode,
        // ageWeighLabel: this.addRuleData.ageWeighLabel,
        routeId: this.addRuleData.routeId,
        ageLow: this.addRuleData.ageLow,
        unequalLow: this.addRuleData.unequalLow,
        ageLowUnit: this.addRuleData.ageLowUnit,
        ageHigh: this.addRuleData.ageHigh,
        unequalHigh: this.addRuleData.unequalHigh,
        ageHighUnit: this.addRuleData.ageHighUnit,
        weighLow: this.addRuleData.weighLow,
        weighHigh: this.addRuleData.weighHigh,
        calculateLabel: this.addRuleData.calculateLabel,
        doseEachLow: this.addRuleData.doseEachLow,
        doseEachLowUnit: this.addRuleData.doseEachLowUnit,
        doseEachHigh: this.addRuleData.doseEachHigh,
        doseEachHighUnit: this.addRuleData.doseEachHighUnit,
        doseDayLow: this.addRuleData.doseDayLow,
        doseDayLowUnit: this.addRuleData.doseDayLowUnit,
        doseDayHigh: this.addRuleData.doseDayHigh,
        doseDayHighUnit: this.addRuleData.doseDayHighUnit,
        maxDoseEach: this.addRuleData.maxDoseEach,
        maxDoseEachUnit: this.addRuleData.maxDoseEachUnit,
        maxDoseDay: this.addRuleData.maxDoseDay,
        maxDoseDayUnit: this.addRuleData.maxDoseDayUnit,
        freQuencyLow: this.addRuleData.freQuencyLow,
        freQuencyLowDay: this.addRuleData.freQuencyLowDay,
        freQuencyHigh: this.addRuleData.freQuencyHigh,
        freQuencyHighDay: this.addRuleData.freQuencyHighDay,
        durationLow: this.addRuleData.durationLow,
        durationHigh: this.addRuleData.durationHigh,
        durationMax: this.addRuleData.durationMax,
        treatmentDose: this.addRuleData.treatmentDose,
        treatmentDoseUnit: this.addRuleData.treatmentDoseUnit,
        warnDoseEach: this.addRuleData.warnDoseEach,
        warnDoseEachUnit: this.addRuleData.warnDoseEachUnit,
        warnDoseDay: this.addRuleData.warnDoseDay,
        warnDoseDayUnit: this.addRuleData.warnDoseDayUnit,
        abstractDesc: this.addRuleData.abstractDesc,
      });
      if (res.code == 1) {
        this.dialogVisible = false;
        this.getRuleListDosa();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "error",
          message: res.msg,
        });
      }
    },
    async addRuleZY() {
      console.log(this.addRuleZYData);
      let res = await this.$rad.addRuleInfoDosaZY({
        drugCode: this.addRuleZYData.drugCode,
        drugType: this.addRuleZYData.drugType,
        toxiLevel: this.addRuleZYData.toxiLevel,
        toxiWarning: this.addRuleZYData.toxiWarning,
        pregnancyLevel: this.addRuleZYData.pregnancyLevel,
        lowDosage: this.addRuleZYData.lowDosage,
        highDosage: this.addRuleZYData.highDosage,
        dosageUnit: this.addRuleZYData.dosageUnit,
      });
      console.log(res);
      if (res.code == 1) {
        this.dialogZYVisible = false;
        this.getRuleListDosa();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "error",
          message: res.msg,
        });
      }
    },
    showRuleAll(dosageDrugId, id, drugName) {
      this.RuleAllData.drugName = drugName;
      this.RuleAllData.dosageDrugId = dosageDrugId;
      console.log(this.RuleAllData.dosageDrugId);
      this.RuleAllData.id = id;
      this.RuleAllVisible = true;
      this.showRuleAllRoute();
    },
    showRuleAllZY(dosageDrugId, id, drugName) {
      this.shwoRuleOneZYData.drugName = drugName;
      this.shwoRuleOneZYData.dosageDrugId = dosageDrugId;
      this.shwoRuleOneZYData.id = id;
      this.showRuleOneZYVisible = true;
      this.showRuleAllZYRoute();
    },
    async showRuleAllZYRoute() {
      let res = await this.$rad.showRuleAllDosaZY({
        id: this.shwoRuleOneZYData.dosageDrugId,
      });
      console.log(res);
      (this.shwoRuleOneZYData.drugName = res.data.drugName),
        (this.shwoRuleOneZYData.toxiLevel = res.data.toxiLevel),
        (this.shwoRuleOneZYData.toxiWarning = res.data.toxiWarning),
        (this.shwoRuleOneZYData.pregnancyLevel = res.data.pregnancyLevel),
        (this.shwoRuleOneZYData.lowDosage = res.data.lowDosage),
        (this.shwoRuleOneZYData.highDosage = res.data.highDosage),
        (this.shwoRuleOneZYData.dosageUnit = res.data.dosageUnit);
    },
    async showRuleAllRoute() {
      let res = await this.$rad.showRuleAllDosa({
        drugId: this.RuleAllData.dosageDrugId,
        page: this.RuleAllData.page,
        pageSize: this.RuleAllData.pageSize,
      });
      this.RuleAllData.RuleAllTableList = res.rows;
      this.RuleAllData.total = res.total;
      console.log(this.RuleAllData.RuleAllTableList);
    },
    showRuleOne(id) {
      this.showRuleOneData.id = id;
      console.log(id);
      this.showRuleOneVisible = true;
      this.showRuleOneRoute();
    },
    async showRuleOneRoute() {
      let res = await this.$rad.showRuleOneDosa({
        id: this.showRuleOneData.id,
      });
      console.log(res);
      this.showRuleOneData.scrId = res.data.scrId;
      this.showRuleOneData.routeName = res.data.routeName;
      this.showRuleOneData.abstractdesc = res.data.abstractdesc;
      this.showRuleOneData.ageLow = res.data.ageLow;
      this.showRuleOneData.unequalLow = res.data.unequalLow;
      this.showRuleOneData.ageLowUnit = res.data.ageLowUnit;
      this.showRuleOneData.ageHigh = res.data.ageHigh;
      this.showRuleOneData.unequalHigh = res.data.unequalHigh;
      this.showRuleOneData.ageHighUnit = res.data.ageHighUnit;
      this.showRuleOneData.weighLow = res.data.weighLow;
      this.showRuleOneData.weighHigh = res.data.weighHigh;
      this.showRuleOneData.calculateLabel = res.data.calculateLabel;
      this.showRuleOneData.doseEachLow = res.data.doseEachLow;
      this.showRuleOneData.doseEachLowUnit = res.data.doseEachLowUnit;
      this.showRuleOneData.doseEachHigh = res.data.doseEachHigh;
      this.showRuleOneData.doseEachHighUnit = res.data.doseEachHighUnit;
      this.showRuleOneData.doseDayLow = res.data.doseDayLow;
      this.showRuleOneData.doseDayLowUnit = res.data.doseDayLowUnit;
      this.showRuleOneData.doseDayHigh = res.data.doseDayHigh;
      this.showRuleOneData.doseDayHighUnit = res.data.doseDayHighUnit;
      this.showRuleOneData.maxDoseEach = res.data.maxDoseEach;
      this.showRuleOneData.maxDoseEachUnit = res.data.maxDoseEachUnit;
      this.showRuleOneData.maxDoseDay = res.data.maxDoseDay;
      this.showRuleOneData.maxDoseDayUnit = res.data.maxDoseDayUnit;
      this.showRuleOneData.freQuencyLow = res.data.freQuencyLow;
      this.showRuleOneData.freQuencyLowDay = res.data.freQuencyLowDay;
      this.showRuleOneData.freQuencyHigh = res.data.freQuencyHigh;
      this.showRuleOneData.freQuencyHighDay = res.data.freQuencyHighDay;
      this.showRuleOneData.durationLow = res.data.durationLow;
      this.showRuleOneData.durationHigh = res.data.durationHigh;
      this.showRuleOneData.durationMax = res.data.durationMax;
      this.showRuleOneData.treatmentDose = res.data.treatmentDose;
      this.showRuleOneData.treatmentDoseUnit = res.data.treatmentDoseUnit;
      this.showRuleOneData.warnDoseEach = res.data.warnDoseEach;
      this.showRuleOneData.warnDoseEachUnit = res.data.warnDoseEachUnit;
      this.showRuleOneData.warnDoseDay = res.data.warnDoseDay;
      this.showRuleOneData.warnDoseDayUnit = res.data.warnDoseDayUnit;
    },
    async updateRuleOne() {
      // console.log(this.showRuleOneData);
      let res = await this.$rad.updateRuleOneDosa({
        scrId: this.showRuleOneData.scrId,
        drugCode: this.showRuleOneData.drugCode,
        // drugType:
        ageWeighLabel: this.showRuleOneData.ageWeighLabel,
        routeId: this.showRuleOneData.routeId,
        ageLow: this.showRuleOneData.ageLow,
        unequalLow: this.showRuleOneData.unequalLow,
        ageLowUnit: this.showRuleOneData.ageLowUnit,
        ageHigh: this.showRuleOneData.ageHigh,
        unequalHigh: this.showRuleOneData.unequalHigh,
        ageHighUnit: this.showRuleOneData.ageHighUnit,
        weighLow: this.showRuleOneData.weighLow,
        weighHigh: this.showRuleOneData.weighHigh,
        calculateLabel: this.showRuleOneData.calculateLabel,
        doseEachLow: this.showRuleOneData.doseEachLow,
        doseEachLowUnit: this.showRuleOneData.doseEachLowUnit,
        doseEachHigh: this.showRuleOneData.doseEachHigh,
        doseEachHighUnit: this.showRuleOneData.doseEachHighUnit,
        doseDayLow: this.showRuleOneData.doseDayLow,
        doseDayLowUnit: this.showRuleOneData.doseDayLowUnit,
        doseDayHigh: this.showRuleOneData.doseDayHigh,
        doseDayHighUnit: this.showRuleOneData.doseDayHighUnit,
        maxDoseEach: this.showRuleOneData.maxDoseEach,
        maxDoseEachUnit: this.showRuleOneData.maxDoseEachUnit,
        maxDoseDay: this.showRuleOneData.maxDoseDay,
        maxDoseDayUnit: this.showRuleOneData.maxDoseDayUnit,
        freQuencyLow: this.showRuleOneData.freQuencyLow,
        freQuencyLowDay: this.showRuleOneData.freQuencyLowDay,
        freQuencyHigh: this.showRuleOneData.freQuencyHigh,
        freQuencyHighDay: this.showRuleOneData.freQuencyHighDay,
        durationLow: this.showRuleOneData.durationLow,
        durationHigh: this.showRuleOneData.durationHigh,
        durationMax: this.showRuleOneData.durationMax,
        treatmentDose: this.showRuleOneData.treatmentDose,
        treatmentDoseUnit: this.showRuleOneData.treatmentDoseUnit,
        warnDoseEach: this.showRuleOneData.warnDoseEach,
        warnDoseEachUnit: this.showRuleOneData.warnDoseEachUnit,
        warnDoseDay: this.showRuleOneData.warnDoseDay,
        warnDoseDayUnit: this.showRuleOneData.warnDoseDayUnit,
        abstractDesc: this.showRuleOneData.abstractDesc,
      });
      if (res.code == 1) {
        this.showRuleOneVisible = false;
        this.showRuleAllRoute();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "success",
          $message: res.msg,
        });
      }
    },
    async updateRuleOneZY() {
      let res = await this.$rad.updateRuleOneZY({
        id: this.shwoRuleOneZYData.dosageDrugId,
        toxiLevel: this.shwoRuleOneZYData.toxiLevel,
        toxiWarning: this.shwoRuleOneZYData.toxiWarning,
        pregnancyLevel: this.shwoRuleOneZYData.pregnancyLevel,
        lowDosage: this.shwoRuleOneZYData.lowDosage,
        highDosage: this.shwoRuleOneZYData.highDosage,
        dosageUnit: this.shwoRuleOneZYData.dosageUnit,
      });
      console.log(res);
    },
    open(id, scrId) {
      this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.deleteRuleDosa(id, scrId);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    async deleteRuleDosa(id, scrId) {
      // console.log(id + "  " + this.RuleAllData.dosageDrugId);
      let res = await this.$rad.deleteRuleDosa({
        id: id,
        scrId: scrId,
      });
      console.log(res);
      if (res.code == 1) {
        // this.showRuleAllRoute();
        // this.getRuleListDosa();
        this.showRuleAllRoute();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "success",
          $message: res.msg,
        });
      }
    },
    open2(id) {
      this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.deleteRuleDosaZY(id);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    async deleteRuleDosaZY(id) {
      // console.log(id + "  " + this.RuleAllData.dosageDrugId);
      let res = await this.$rad.deleteRuleDosaZY({
        id: id,
      });
      console.log(res);
      if (res.code == 1) {
        // this.showRuleAllRoute();
        // this.getRuleListDosa();
        this.showRuleAllZYRoute();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "success",
          $message: res.msg,
        });
      }
    },

    showDisease(load) {
      this.DiseaseData.load = load;
      this.DiseaseVisible = true;
      this.showRuleDiseaseAge();
    },
    async showRuleDiseaseAge() {
      let res = await this.$rad.showRuleDiseaseAge({
        srm: this.DiseaseData.srm,
        page: this.DiseaseData.page,
        pageSize: this.DiseaseData.pageSize,
      });
      console.log(res);
      this.DiseaseData.tableData = res.rows;
      this.DiseaseData.total = res.total;
    },
    SelectDisease() {
      if (this.DiseaseData.radioId.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择疾病诊断",
        });
      } else {
        if (this.DiseaseData.load == 1) {
          console.log(this.DiseaseData.radioId);
          this.addRuleData.icdName = this.DiseaseData.radioId.zdmc;
          this.addRuleData.icdCodes = this.DiseaseData.radioId.zddm;
        } else if (this.DiseaseData.load == 2) {
          // console.log
          this.showRuleOneData.icdName = this.DiseaseData.radioId.zdmc;
          this.showRuleOneData.icdCodes = this.DiseaseData.radioId.zddm;
        }

        this.DiseaseVisible = false;
      }
    },
    handleRow(row) {
      console.log(row);
      this.routeData.radioId = row;
      this.multipleSelection = row;
    },
    handleSelectionChange(val) {
      console.log(res);
      this.multipleSelection = val;
    },
  },
};
</script>
<style scoped>
.SearchCard {
  height: 50px;
  font-size: 12px;
}
.SearchTitle {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid #c2c2c2;
}
.SearchLable {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.TableCard {
  margin-left: 3px;
  margin-top: 2px;
}
.block {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 12px;
}
.editDialog >>> .el-dialog__header {
  margin-bottom: 0px;
}
.editDialog >>> .el-dialog__body {
  padding-left: 0px;
  padding-right: 0px;
}
.addInput {
  height: 45px;
  display: flex;
  align-items: center;
}
.SortFoot {
  height: 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.addInput >>> .el-input {
  width: 40%;
  margin-left: 8px;
}
.addInput >>> .el-button {
  margin-left: 8px;
}
.dialogBlock {
  margin-top: 0px;
  margin-bottom: 0px;
}
.addRuleAdverse >>> .el-form-item {
  width: 100%;
}
.addForm >>> .el-form-item__content {
  width: 200px;
}
</style>